//
//  ExhibitorsDetailsViewController.m
//  ppkc2016
//
//  Created by 拼凑的断音 on 16/3/29.
//  Copyright © 2016年 拼凑的断音. All rights reserved.
//

#import "ExhibitorsDetailsViewController.h"
#import "XXTool.h"
#import "ShowTipAndContentClickCell.h"
#import "ExhibitorsDetailsHeadCell.h"
#import "ViewBusinessPosterButton.h"

#import "XVCAppointMentExhibitor.h"
#import "XMLExhibitorCollectOrAppointment.h"
#import "RXMLExhibitorIndexModel.h"
#import "XVCVisitorAppointmentDetail.h"

#import <MessageUI/MessageUI.h>
#import "XVCRegionalShowViewController.h"

#import "XMLMapListModel.h"

@interface ExhibitorsDetailsViewController ()<UITableViewDelegate,UITableViewDataSource,UIActionSheetDelegate,MFMailComposeViewControllerDelegate,ExhibitorsDetailsHeadCellDelegate,UIAlertViewDelegate>

@property (nonatomic) UITableView* tableview;

@property (nonatomic) ViewBusinessPosterButton *posterButton;  //展商宣传资料

@property (nonatomic, strong) DKButton *closeButton;

@end

@implementation ExhibitorsDetailsViewController
{
    NSMutableArray <XMLNameAndValueModel*> *useData;
    XMLExhibitorCollectOrAppointment *statusData;
    NSMutableArray *productImgArray;
    NSString *callNumber;
    NSString *emailSend;
    
    NSMutableArray <XMLMapListModel*> *needUpdateMapArray;
}

-(UITableView*)tableview
{
    if (_tableview==nil)
    {
        _tableview = [[UITableView alloc] init];
        _tableview.delegate = self;
        _tableview.dataSource = self;
        _tableview.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
        _tableview.separatorColor = [XXTool colorWithLine];
        [_tableview setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
        [self.view addSubview:_tableview];
    }
    return _tableview;
}

-(ViewBusinessPosterButton*)posterButton
{
    if (_posterButton==nil)
    {
        _posterButton = [[ViewBusinessPosterButton alloc] init];
        [_posterButton addTarget:self Select:@selector(clickPosterButton) ForEvent:DKButtonEventPressedEnd];
        [self.view addSubview:_posterButton];
    }
    return _posterButton;
}

-(DKButton*)closeButton
{
    if (_closeButton == nil)
    {
        _closeButton = [DKButton new];
        _closeButton.text = NSLocalizedString(@"关闭", nil);
        [_closeButton setColor:[UIColor clearColor] ForState:DKButtonStateNormal];
        [_closeButton addTarget:self Select:@selector(onTapClose) ForEvent:DKButtonEventPressedEnd];
        _closeButton.frame = CGRectMake(30, 0, 50, 44);
    }
    return _closeButton;
}

#pragma mark Setter
-(void)setInfoData:(RXMLExhibitorInformationModel *)infoData
{
    _infoData = infoData;
    useData = [NSMutableArray array];
    productImgArray = [NSMutableArray array];
    
    if (![_infoData.HallNo isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"展馆", nil);
        NSString *hall = [_infoData.HallNo substringToIndex:1];
        nameValueModel.value = [NSString stringWithFormat:@"N%@",hall];
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.StandNo isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"展位号", nil);
        nameValueModel.value = _infoData.StandNo;
        nameValueModel.useType = XMLNameAndValueModelNeedClick;
        [useData addObject:nameValueModel];
    }
   
    if (![_infoData.Country isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"国家", nil);
        nameValueModel.value = _infoData.Country;
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.Tel isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"电话", nil);
        nameValueModel.value = _infoData.Tel;
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.Fax isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"传真", nil);
        nameValueModel.value = _infoData.Fax;
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.Email isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"邮箱", nil);
        nameValueModel.value = _infoData.Email;
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.Website isEqualToString:@""])
    {
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"网址", nil);
        nameValueModel.value = _infoData.Website;
        [useData addObject:nameValueModel];
    }
    
    if (![_infoData.ProductIndex isEqualToString:@""])
    {
        NSString *indexShow = @"";
        NSArray *exIndexArray = [_infoData.ProductIndex componentsSeparatedByString:@","];
        for (NSString *temp in exIndexArray)
        {
            RLMResults *indexText = [RXMLExhibitorIndexModel objectsInRealm:[RLMRealm realmWithPath:[XXTool dataBasePath]] where:[NSString stringWithFormat:@"index_NO = '%@'",temp]];
            
            if (indexText.count>0)
            {
                RXMLExhibitorIndexModel *indexModel = indexText[0];
                if ([XXTool didCurrentLanguageChinese])
                {
                    indexShow = [NSString stringWithFormat:@"%@\r%@",indexShow,indexModel.index_name_cn];
                }
                else
                {
                    indexShow = [NSString stringWithFormat:@"%@\r%@",indexShow,indexModel.index_name_en];
                }
                
            }
        }
        //去除多余/r
        if (indexShow.length>2)
        {
            indexShow = [indexShow substringFromIndex:1];
        }
        
        XMLNameAndValueModel *nameValueModel = [[XMLNameAndValueModel alloc] init];
        nameValueModel.name = NSLocalizedString(@"产品索引", nil);
        nameValueModel.value = indexShow;
        [useData addObject:nameValueModel];
    }
    if (_infoData.ProductImage)
    {
        [productImgArray addObject:_infoData.ProductImage];
    }
}

-(void)initParameter
{
    
}

-(void)initUI
{
    [self.navigationItem setTitle:NSLocalizedString(@"展商详情", nil)];
    
    [self tableview];
    [self posterButton];
}

-(void)refreshLayout:(CGRect)frame
{
    if ([statusData.zs_hburltype intValue]==0)
    {
        _posterButton.hidden = YES;
        _tableview.frame = CGRectMake(0, 0, frame.size.width
                                      , frame.size.height);
    }
    else
    {
        _posterButton.hidden = NO;
        _tableview.frame = CGRectMake(0, 0, frame.size.width
                                      , frame.size.height-50);
        
       
        _posterButton.frame = CGRectMake(17/2
                                         , _tableview.frame.size.height+_tableview.frame.origin.y+3
                                         , frame.size.width-17
                                         , 40);
    }
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar addSubview:self.closeButton];
    [SVProgressHUD show];
    [XMLExhibitorCollectOrAppointment requestExhibitorCollectAndOrderStatusWithExID:_infoData.ExhibitorID
                                                                          comletion:^(BOOL isSuccess, XMLExhibitorCollectOrAppointment *dataUse) {
                                                                              if (isSuccess)
                                                                              {
                                                                                  statusData = dataUse;
                                                                                  [_tableview reloadData];
                                                                                  [self refreshLayout];
                                                                                  [SVProgressHUD dismiss];
                                                                              }
                                                                          }];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.closeButton removeFromSuperview];
}

#pragma mark tableviewDataSource
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0)
    {
        NSString* reuseIdentifier = @"ExhibitorsDetailsHeadCell";
        ExhibitorsDetailsHeadCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
        if(cell==nil)
        {
            cell = [[ExhibitorsDetailsHeadCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            cell.delegate = self;
            
            NSString *comName = @"";
            if ([_infoData.CompanyName_eng isEqualToString:@""])
            {
                comName = _infoData.CompanyName_chn;
            }
            else if ([_infoData.CompanyName_chn isEqualToString:@""])
            {
                comName = _infoData.CompanyName_eng;
            }
            else
            {
                comName = [NSString stringWithFormat:@"%@\n\r%@",_infoData.CompanyName_eng,_infoData.CompanyName_chn];
            }
            [cell setCellWithExhibitorName:comName productImg:productImgArray];
        }
        [cell setCellWithCollectionOrOrderStatus:statusData];
        return cell;
    }
    else
    {
        NSString* reuseIdentifier = @"ShowTipAndContentClickCell";
        ShowTipAndContentClickCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
        if(cell==nil)
        {
            cell = [[ShowTipAndContentClickCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
        }
        [cell setCellWithData:useData[indexPath.row-1]];
        return cell;
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==0)
    {
        return 170;
    }
    return [ShowTipAndContentClickCell getCellHeightWithData:useData[indexPath.row-1]];
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return useData.count+1;
}

#pragma mark tableviewDelegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    if (indexPath.row!=0)
    {
        XMLNameAndValueModel *temp = useData[indexPath.row-1];
        if ([temp.name isEqualToString:NSLocalizedString(@"电话", nil)])
        {
            callNumber = temp.value;
            UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:nil
                                                            delegate:self
                                                   cancelButtonTitle:NSLocalizedString(@"取消",nil)
                                              destructiveButtonTitle:[NSString stringWithFormat:@"%@:%@",NSLocalizedString(@"拨打", nil),callNumber]
                                                   otherButtonTitles:nil, nil];
            as.tag = 10;
            [as showInView:self.view];
        }
        
        else if ([temp.name isEqualToString:NSLocalizedString(@"展位号", nil)])
        {
            NSString *exName = @"";
            NSString *exBooth = @"";
            if ([XXTool didCurrentLanguageChinese])
            {
                if ([_infoData.CompanyName_chn isEqualToString:@""])
                {
                    exName = _infoData.CompanyName_eng;
                }
                else
                {
                    exName = _infoData.CompanyName_chn;
                }
                exBooth = [NSString stringWithFormat:@"展位号 %@",_infoData.StandNo];
            }
            else
            {
                if ([_infoData.CompanyName_eng isEqualToString:@""])
                {
                    exName = _infoData.CompanyName_chn;
                }
                else
                {
                    exName = _infoData.CompanyName_eng;
                }
                exBooth = [NSString stringWithFormat:@"BoothNo %@",_infoData.StandNo];
            }
            
            needUpdateMapArray = [NSMutableArray array];
            [XMLMapListModel checkMapWithMtype:1 complete:^(BOOL isNeedUpdate, NSMutableArray<XMLMapListModel *> *updateMapArray) {
                if (isNeedUpdate)
                {
                    [needUpdateMapArray addObjectsFromArray:updateMapArray];
                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"提示", nil)
                                                                    message:NSLocalizedString(@"有新地图，是否更新", nil)
                                                                   delegate:self
                                                          cancelButtonTitle:NSLocalizedString(@"取消", nil)
                                                          otherButtonTitles:NSLocalizedString(@"确定", nil), nil];
                    alert.tag = 3;
                    [alert show];
                }
                else
                {
                    NSFileManager *fileManager = [NSFileManager defaultManager];
                    NSString *hallMap = [NSString stringWithFormat:@"%@/Documents/1%@.html",NSHomeDirectory(),useData[0].value];
                    if ([fileManager fileExistsAtPath:hallMap])
                    {
                        [WebController pushWebControllerWithSourceVC:self isNeedTitleLabel:YES requestString:hallMap mapType:WebControllerHallShowMapUse mapTitle:useData[0].value signID:temp.value boothNo:exBooth Company:exName];
                    }
                }
            }];
        }
        
        else if ([temp.name isEqualToString:NSLocalizedString(@"网址", nil)])
        {
            [WebController pushWebControllerWithSourceVC:self requestString:temp.value mapTitle:nil];
        }
        else if ([temp.name isEqualToString:NSLocalizedString(@"邮箱", nil)])
        {
            emailSend = temp.value;
            UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:nil
                                                            delegate:self
                                                   cancelButtonTitle:NSLocalizedString(@"取消",nil)
                                              destructiveButtonTitle:[NSString stringWithFormat:@"%@:%@",NSLocalizedString(@"邮箱", nil),emailSend]
                                                   otherButtonTitles:nil, nil];
            as.tag = 20;
            [as showInView:self.view];
        }
    }
}

#pragma mark UIAlertViewDelegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView.tag==3)
    {
        if (buttonIndex==1)
        {
            NSMutableArray <XMLXXDownFileModel*>* downfileArray = [NSMutableArray array];
            
            if (needUpdateMapArray.count > 0)
            {
                for (int i = 0; i < needUpdateMapArray.count; i ++)
                {
                    XMLMapListModel *temp = needUpdateMapArray[i];
                    
                    NSString *imgtypeString = @"";
                    if ([temp.mtype integerValue] == 1)
                    {
                        XMLXXDownFileModel *html = [XMLXXDownFileModel newXXDownFileModelWithUrl:temp.mapphtml saveName:[NSString stringWithFormat:@"%@%@.html",temp.mtype,temp.mapname] saveType:HTML];
                        [downfileArray addObject:html];
                        
                        imgtypeString = [temp.mappath substringFromIndex:temp.mappath.length - 3];
                    }
                    else
                    {
                        imgtypeString = @"png";
                    }
                    
                    XMLXXDownFileModel *img = [XMLXXDownFileModel newXXDownFileModelWithUrl:temp.mappath saveName:[NSString stringWithFormat:@"%@%@.%@",temp.mtype,temp.mapname,imgtypeString] saveType:IMG];
                    [downfileArray addObject:img];
                }
            }
            
            UIAlertView *progressAlert = [[UIAlertView alloc] initWithTitle:nil
                                                                    message:NSLocalizedString(@"正在下载", nil)
                                                                   delegate:self
                                                          cancelButtonTitle:NSLocalizedString(@"取消", nil)
                                                          otherButtonTitles:nil, nil];
            [progressAlert showWithProgress];
            [progressAlert show];
            
            [XXDownFileToFoler
             downFileWithUrlArray:downfileArray
             downProgressBlock:^(float rate) {
                 [progressAlert setProgressWithRate:rate];
             } completeBlock:^(BOOL isSuccess) {
                 [progressAlert dismissWithClickedButtonIndex:0 animated:NO];
                 [SVProgressHUD showSuccessWithStatus:NSLocalizedString(@"地图更新成功", nil)];
                 //地图更新成功，更新地图对应版本号
                 NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
                 for (int i = 0; i < needUpdateMapArray.count; i ++)
                 {
                     XMLMapListModel *temp = needUpdateMapArray[i];
                     [user setInteger:[temp.mapversion integerValue] forKey:[NSString stringWithFormat:@"%@%@%@",temp.mtype,mtypeMapVision,temp.mapname]];
                 }
                 [user synchronize];
             }];
        }
    }
}


#pragma mark actionsheetdelegate
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (actionSheet.tag==10) //电话
    {
        if(buttonIndex==0)
        {
            callNumber = [callNumber stringByReplacingOccurrencesOfString:@" " withString:@""];
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",callNumber]]];
        }
    }
    if (actionSheet.tag==20) //邮件
    {
        if (buttonIndex==0)
        {
            if ([MFMailComposeViewController canSendMail]) // 用户已设置邮件账户
            {
                [self sendEmailAction]; // 调用发送邮件的代码
            }
            else
            {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@",emailSend]]];
            }
        }
    }
}

#pragma mark ExhibitorsDetailsHeadCellDelegate
-(void)exhibitorsDetailsHeadCellDidClickAppointExhibitorButtonWithButton:(DKButton *)bespeak
{
    if ([bespeak.text isEqualToString:NSLocalizedString(@"已预约", nil)])
    {
        [XVCVisitorAppointmentDetail pushVistorAppointmentDetailWithSourceVC:self apmentID:statusData.orderid];
    }
    else if ([bespeak.text isEqualToString:NSLocalizedString(@"预约", nil)])
    {
        [XVCAppointMentExhibitor pushAppointMentExhibitorWithSourceVC:self exhibitorId:_infoData.ExhibitorID];
    }
}

-(void)exhibitorsDetailsHeadCellDidClickCollectButtonWithButton:(DKButton *)collect
{
    NSString *type = @"";
    if ([statusData.collection intValue]==1) //已收藏
    {
        type = @"2";
    }
    else if ([statusData.collection intValue]==0) //未收藏
    {
        type = @"1";
    }
    [SVProgressHUD show];
    [DKHTTPRequest sendDataWithShortUrl:@"favorites_visitor_co_exhibitor"
                                  Param:[XXTool formatStringWithLanguage:[NSString stringWithFormat:@"userid=%@&passwd=%@&exhibitorid=%@&type=%@",[UserInfo shareUserInfo].userID,[UserInfo shareUserInfo].userPassword,_infoData.ExhibitorID,type]]
                             ImageArray:nil
                                TimeOut:10
                             Completion:^BOOL(NSMutableDictionary *serverDic, DKHTTPResponseType bufferType) {
                                 if ([[serverDic objectForKey:@"code"] intValue]==200)
                                 {
                                     if ([type isEqualToString:@"2"])
                                     {
                                         collect.image = [UIImage imageNamed:@"收藏按钮_未点击"];
                                         collect.text = NSLocalizedString(@"收藏", nil);
                                         statusData.collection = @"0";
                                     }
                                     else if ([type isEqualToString:@"1"])
                                     {
                                         collect.image = [UIImage imageNamed:@"收藏按钮_已点击"];
                                         collect.text = NSLocalizedString(@"已收藏", nil);
                                         statusData.collection = @"1";
                                     }
                                     [SVProgressHUD showSuccessWithStatus:NSLocalizedString(@"操作成功", nil)];
                                 }
                                 return YES;
                             } IsBuffering:NO
                      IsNeedReplaceWrap:NO
                        IsUseUpLoadHead:NO];
}

#pragma mark action
-(void)onTapClose
{
    NSMutableArray *viewcontrollers = [[self.navigationController viewControllers] mutableCopy];
    [viewcontrollers removeObjectsInRange:NSMakeRange(2, viewcontrollers.count-2)];
    [self.navigationController setViewControllers:viewcontrollers animated:YES];
}

#pragma mark posterButton
-(void)clickPosterButton
{
    NSString *exName = @"";
    if ([XXTool didCurrentLanguageChinese])
    {
        if ([_infoData.CompanyName_chn isEqualToString:@""])
        {
            exName = _infoData.CompanyName_eng;
        }
        else
        {
             exName = _infoData.CompanyName_chn;
        }
    }
    else
    {
        if ([_infoData.CompanyName_eng isEqualToString:@""])
        {
            exName = _infoData.CompanyName_chn;
        }
        else
        {
            exName = _infoData.CompanyName_eng;
        }
    }
    if ([statusData.zs_hburltype intValue]==1) //跳转网页
    {
        [WebController pushWebControllerWithSourceVC:self requestString:statusData.zs_hburl
                                             mapType:WebControllerDefault
                                            mapTitle:exName
                                              signID:@""
                                              Company:@""];
    }
    else if ([statusData.zs_hburltype intValue]==2) //图片展示
    {
        [XVCRegionalShowViewController pushRegionalShowVCWithSourceVC:self WithShowType:ProductImgShow imgUrl:statusData.zs_hburl];
    }
    
}

#pragma mark sendEmailAction
-(void)sendEmailAction
{
    // 邮件服务器
    MFMailComposeViewController *mailCompose = [[MFMailComposeViewController alloc] init];
    // 设置邮件代理
    [mailCompose setMailComposeDelegate:self];
    // 设置邮件主题
    //[mailCompose setSubject:@""];
    // 设置收件人
    [mailCompose setToRecipients:@[emailSend]];
    // 设置抄送人
    //[mailCompose setCcRecipients:@[@""]];
    // 设置密抄送
    //[mailCompose setBccRecipients:@[@""]];
    
     //设置邮件的正文内容
     //NSString *emailContent = @"我是邮件内容";
    // 是否为HTML格式
     //[mailCompose setMessageBody:emailContent isHTML:NO];
    // 如使用HTML格式，则为以下代码
    //	[mailCompose setMessageBody:@"<html><body><p>Hello</p><p>World！</p></body></html>" isHTML:YES];
  
     //添加附件

//    UIImage *image = [UIImage imageNamed:@"image"];
//    NSData *imageData = UIImagePNGRepresentation(image);
//    [mailCompose addAttachmentData:imageData mimeType:@"" fileName:@"custom.png"];
//    NSString *file = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"];
//    NSData *pdf = [NSData dataWithContentsOfFile:file];
//    [mailCompose addAttachmentData:pdf mimeType:@"" fileName:@"7天精通IOS233333"];
    // 弹出邮件发送视图
    [self presentViewController:mailCompose animated:YES completion:nil];
}

#pragma mark MFMessageComposeViewControllerDelegate
- (void)mailComposeController:(MFMailComposeViewController *)controller
          didFinishWithResult:(MFMailComposeResult)result
                        error:(NSError *)error
{
    switch (result)
    {
        case MFMailComposeResultCancelled: // 用户取消编辑
            NSLog(@"Mail send canceled...");
            break;
        case MFMailComposeResultSaved: // 用户保存邮件
            NSLog(@"Mail saved...");
            break;
        case MFMailComposeResultSent: // 用户点击发送
            NSLog(@"Mail sent...");
            break;
        case MFMailComposeResultFailed: // 用户尝试保存或发送邮件失败
            NSLog(@"Mail send errored: %@...", [error localizedDescription]);
            break;
    }
    // 关闭邮件发送视图
    [self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark Api
+(void)pushViewControllerWithSourceVC:(UIViewController *)vc exhibitorInfo:(RXMLExhibitorInformationModel *)info
{
    ExhibitorsDetailsViewController *pushVC = [[ExhibitorsDetailsViewController alloc] init];
    pushVC.infoData = info;
    [vc.navigationController pushViewController:pushVC animated:YES];
}
  
@end
